package com.example.demo.Dao;

import com.example.demo.enity.RoleInfo;
import com.example.demo.enity.UserInfo;
import com.example.demo.enity.UserInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface UserInfoMapper {
    long countByExample(UserInfoExample example);

    int deleteByExample(UserInfoExample example);

    int deleteByPrimaryKey(Integer uid);

    int insert(UserInfo record);

    int insertSelective(UserInfo record);

    List<UserInfo> selectByExample(UserInfoExample example);
    
    //通过电话号码查询用户,登录验证时使用
    UserInfo loadUserInfoByUtel(String utel);
    
    //查询用户角色信息,用于登录验证
    List<RoleInfo> loadUserRoleInfoByUid(Integer uid);

    UserInfo selectByPrimaryKey(Integer uid);

    int updateByExampleSelective(@Param("record") UserInfo record, @Param("example") UserInfoExample example);

    int updateByExample(@Param("record") UserInfo record, @Param("example") UserInfoExample example);

    int updateByPrimaryKeySelective(UserInfo record);

    int updateByPrimaryKey(UserInfo record);
    //修改密码
    int updatePassword(String utel,String newpassword);
    //查询所有违规用户
    List<RoleInfo> selectAllIlleageUser(UserInfoExample example);
    
    int bannedUser(Integer uid);
}